<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>分页</title>
  <link rel="stylesheet" href="../layui/css/layui.css" th:href="@{../layui/css/layui.css}" media="all">
</head>
<body>
 
<div id="pTable" style="width: 100%;">
     <table class="layui-table" id="layui_table_id" lay-filter="test"></table>
</div>
 
<script th:src="@{../layui/layui.js}"></script>
<script>
var limitcount = 10;
var curnum = 1;
//列表查询方法
function productsearch(productGroupId,start,limitsize) {
    layui.use(['table','laypage','laydate'], function(){
        var table = layui.table,
            laydate=layui.laydate,
            laypage = layui.laypage;
        table.render({
            elem: '#layui_table_id'
            , url: '../partyMember/listPartyMemberByPage'
            		//, url: '../images/test.json'
            		   ,response: {
    					statusCode: 200 //规定成功的状态码，默认：0
  						} 
            , cols: [
            	[
                {field: 'id', title: '用户ID', width: '200', sort: true}
                , {field: 'name', title: '用户名', width: '200'}
                , {field: 'sex', title: '性别', width: '200'}
                , {field: 'phone', title: '电话', width: '200', sort: true}
                , {field: 'state', title: '状态', width: '120', sort: true}
                , {field: 'email', title: '邮箱', width: '200', sort: true}
                , {field: 'idnum', title: '身份证号', width: '200'}
                , {field: 'org', title: '所属组织', width: '200'}
                , {field: 'pmp', title: '党员权限', width: '200'}
            ]
            	]
            , page: true
            ,done: function(res, curr, count){
                //如果是异步请求数据方式，res即为你接口返回的信息。
                //如果是直接赋值的方式，res即为：{data: [], count: 99} data为当前页数据、count为数据总长度
                laypage.render({
                    elem:'laypage'
                    ,count:count
                    ,curr:curnum
                    ,limit:limitcount
                    ,layout: ['prev', 'page', 'next', 'skip','count','limit']
                    ,jump:function (obj,first) {
                        if(!first){
                            curnum = obj.curr;
                            limitcount = obj.limit;
                        }
                    }
                })
            }
        })

        //监听工具条
    
    });
}

productsearch(curnum, limitcount);
</script>
</body>
</html>